﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

typedef char BTDataType;

typedef struct BinaryTreeNode
{
	BTDataType val;

	struct BinaryTreeNode* left;
	struct BinaryTreeNode* right;
}BTNode;

BTNode* BuyBTNode(BTDataType val);

BTNode* BinaryTreeCreate(BTDataType* a,int* pi);

void Preorder(BTNode* A);
void Inorder(BTNode* A);
void Postorder(BTNode* A);

int BinaryTreeSize(BTNode* root);

int BinaryTreeLeafSize(BTNode* root);

int BinaryTreeLevelKSize(BTNode* root, int k);

int BinaryTreeDepth(BTNode* root);

BTNode* BinaryTreeFind(BTNode* root, BTDataType x);

void BinaryTreeDestory(BTNode** root);

void LevelOrder(BTNode* root);

bool BinaryTreeComplete(BTNode* root);
